﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace WilkeService
{
    
    public class Service1 : IService1
    {
        Cls_Group group;
        Cls_ServiceConroller serviceController;

       


        public bool ChangeGroupMessage(string groupName, string message)
        {
            bool changed = false;

            foreach (Cls_Group g in serviceController.ListGroup)
            {
                if (g.GroupName == groupName)
                {
                    try
                    {
                        g.Msg.Msg = message;
                        changed = true;
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }

            return changed;
        }

        public bool AddProgramToGroup(string groupName, string path, string programName)
        {
            bool added = false;

            foreach (Cls_Group g in serviceController.ListGroup)
            {
                if (g.GroupName == groupName)
                {
                    try
                    {
                        g.AddProgramToGroup(programName, path);

                        added = true;
                    }
                    catch (Exception ex)
                    {
                        throw ex;

                    }
                }
            }
            return added;
        }
    }
}
